#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int n, m;
int a[N], s[N];

int main() {
	cin >> n >> m;
	for (int i = 1; i <= n; ++i) {
		cin >> a[i];
		s[i] = a[i] - a[i - 1];
	}
	while (m--) {
		int l, r, c;
		cin >> l >> r >> c;
		s[r + 1] -= c;
		s[l] += c;
	}
	for (int i = 1; i <= n; ++i) {
		s[i] += s[i - 1];
		cout << s[i] << ' ';
	}
	return 0;
}